{config_load file=test.conf section="setup"}
{include file="header.html" title_page=Add name=Money}

<form name="form_data" method="POST" action="">
  <table class="data_edit">
  <tr>
    <td class="left_td">类型：</td>
    <td>
      <select name="type" id="type" onchange="javascript:category_type_dis();">
        <option value="0">花了</option>
        <option value="1">赚了</option>
      </select>
      <label><input type="radio" name="pay_type" value="1" title="支付方式 - 现金" checked="checked"/>现金</label>
      <label><input type="radio" name="pay_type" value="0" title="支付方式 - 信用卡"/>信用卡</label>
    </td>
  </tr>
  <tr>
    <td class="left_td">金额：</td>
    <td>
      <input type="text" name="money" value="{$item_values.money}" /> 元
    </td>
  </tr>
  <tr>
    <td class="left_td">标题：</td>
    <td>
      <input type="text" name="caption" value="{$item_values.caption}" />
    </td>
  </tr>
  <tr>
    <td class="left_td">内容：</td>
    <td>
      <textarea name="content" rows="7" cols="35">{$item_values.content}</textarea>
    </td>
  </tr>
  <tr>
    <td class="left_td">图片：</td>
    <td>
      <label><input type="radio" name="pic_type" value="0" checked="checked" />无</label>
      <label><input type="radio" name="pic_type" value="1" />外链</label>
      <!--label><input type="radio" name="pic_type" value="2" />上传</label-->
      <br/>
      <input type="text" name="picture" value="{$item_values.picture}" size="40" /> 注：暂时只支持外链
    </td>
  </tr>
  <tr>
    <td class="left_td">时间：</td>
    <td>
      {html_select_date start_year=2008 end_year=2050 field_order=YMD month_format=%m} - {html_select_time}
    </td>
  </tr>
  <tr>
    <td class="left_td">是否隐私：</td>
    <td>
      <label><input type="radio" name="privacy" value="0" checked="checked" />否</label>
      <label><input type="radio" name="privacy" value="1" />是</label>
    </td>
  </tr>
  <tr>
    <td class="left_td">分类：</td>
    <td>
      <select name="category_pay" id="category_pay">
      {html_options values=$option_values_pay output=$option_output_pay selected=$option_selected_pay}
      </select>
	  <select name="category_income" id="category_income">
      {html_options values=$option_values_income output=$option_output_income selected=$option_selected_income}
	  </select>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="submit_td">
	  <input type="hidden" name="item_id" value="{$item_values.id}" />
      <input type="submit" value="保存" />
      <input type="button" value="返回" onclick="javascript: history.back();" />
    <td/>
  </tr>
  </table>
</form>
<script type="text/javascript">
function set_value()
{literal}
{
{/literal}
  $("input[name='pay_type']")[{if isset($item_values.pay_type)}{$item_values.pay_type}{else}0{/if}].checked = true;
  $("input[name='pic_type']")[{if isset($item_values.picture_type)}{$item_values.picture_type}{else}0{/if}].checked = true;
  $("input[name='privacy']")[{if isset($item_values.privacy)}{$item_values.privacy}{else}0{/if}].checked = true;
  $("#type").val({$type});
{literal}
  category_type_dis();
}
{/literal}

{literal}
function category_type_dis()
{
  if ($("#type").val() == 1){
	$("#category_pay").css('display', 'none');
	$("#category_income").css('display', 'block');
  }else{
	$("#category_pay").css('display', 'block');
	$("#category_income").css('display', 'none');
  }
}

function check_data()
{
  
}
{/literal}
</script>

{include file="footer.html"}